<?php
include(dirname(__FILE__).'/top-bottom-share-data.php');
$dt = new DataTable(constant('DB_TABLE_ARTICLE'));
$GLOBALS['GV_IMAGE_PATH'] = 'article/';

$GLOBALS['PAGE_ROW_DATA'] = $dt->get(intval($_REQUEST['id']));

$dt_image =  new DataTable(constant('DB_TABLE_ARTICLE_IMAGE'));
$GLOBALS['PAGE_ROW_DATA']['a_style_img'] = $dt_image->get_list(sprintf("`article_id`=%d",$GLOBALS['PAGE_ROW_DATA']['id']), 'id');
//meta key words
$GLOBALS['PAGE_ROW_DATA']['meta_keyword'] = $GLOBALS['APP_INSTANCE']->meta_idStr_to_valueStr($GLOBALS['PAGE_ROW_DATA']['meta_keyword'] );

//relative articles
$GLOBALS['PAGE_RELATIVE_DATA'] = $dt->get_rand_list(3, sprintf("`cat_id`=%d AND `id` != %d",$GLOBALS['PAGE_ROW_DATA']['cat_id'],$GLOBALS['PAGE_ROW_DATA']['id']));


//show login link
if ( $GLOBALS['PAGE_ROW_DATA']['cat_id'] == 2 && $GLOBALS['PAGE_ROW_DATA']['sub_cat_id'] == 5 ){
	$GLOBALS['PAGE_SHOW_PRINT_LINK'] = TRUE;
}else{
	$GLOBALS['PAGE_SHOW_PRINT_LINK'] = FALSE;
}
//facebook share
$GLOBALS['META_FB_IMAGE'] = constant('SITE_URL_PATH').'/img/article/'.$GLOBALS['PAGE_ROW_DATA']['img_path'];
$GLOBALS['META_FB_TITLE'] = '[班尼頓寫真攝影] ';
$GLOBALS['META_FB_TITLE'] .= $GLOBALS['GV_ARTICLE_SUB_CAT'][$GLOBALS['PAGE_ROW_DATA']['cat_id']][$GLOBALS['PAGE_ROW_DATA']['sub_cat_id']];
$GLOBALS['META_FB_TITLE'] .= $GLOBALS['PAGE_ROW_DATA']['title'];
$GLOBALS['META_FB_URL'] =  constant('SITE_URL_PATH').'/contactb.php?id='.$GLOBALS['PAGE_ROW_DATA']['id'];


?>